From 09847df8d30b1572e85d58be477e7c24117c8431 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 1 Mar 2016 08:24:43 -0800 Subject: [PATCH] Fix all tests with recent changes The package id for path dependencies now has another path component pointing precisely to the package being compiled, so lots of tests need their output matches to get updated. --- src/cargo/util/paths.rs | 8 ++-- tests/test_cargo_compile.rs | 6 +-- tests/test_cargo_compile_custom_build.rs | 2 +- tests/test_cargo_compile_git_deps.rs | 8 ++-- tests/test_cargo_compile_path_deps.rs | 56 ++++++++++++------------ tests/test_cargo_compile_plugins.rs | 4 +- tests/test_cargo_cross_compile.rs | 4 +- tests/test_cargo_doc.rs | 6 +-- tests/test_cargo_features.rs | 20 ++++----- tests/test_cargo_install.rs | 20 ++++++--- tests/test_cargo_package.rs | 15 ++++++- tests/test_cargo_profiles.rs | 2 +- tests/test_cargo_registry.rs | 4 +- tests/test_cargo_run.rs | 4 +- tests/test_cargo_rustc.rs | 7 ++- tests/test_cargo_rustdoc.rs | 14 +++--- tests/test_cargo_test.rs | 12 ++--- 17 files changed, 105 insertions(+), 87 deletions(-) diff --git a/src/cargo/util/paths.rs b/src/cargo/util/paths.rs index 2e9397df6..5770b80ea 100644 --- a/src/cargo/util/paths.rs +++ b/src/cargo/util/paths.rs @@ -73,8 +73,8 @@ pub fn read(path: &Path) -> CargoResult { let mut f = try!(File::open(path)); try!(f.read_to_string(&mut ret)); Ok(ret) - }).chain_error(|| { - internal(format!("failed to read `{}`", path.display())) + })().map_err(human).chain_error(|| { + human(format!("failed to read `{}`", path.display())) }) } @@ -83,8 +83,8 @@ pub fn write(path: &Path, contents: &[u8]) -> CargoResult<()> { let mut f = try!(File::create(path)); try!(f.write_all(contents)); Ok(()) - }).chain_error(|| { - internal(format!("failed to write `{}`", path.display())) + })().map_err(human).chain_error(|| { + human(format!("failed to write `{}`", path.display())) }) } diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index 2fddc664c..897043e72 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -315,7 +315,7 @@ test!(cargo_compile_with_warnings_in_a_dep_package { assert_that(p.cargo_process("build"), execs() - .with_stdout(&format!("{} bar v0.5.0 ({})\n\ + .with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url())) @@ -607,7 +607,7 @@ test!(cargo_compile_with_dep_name_mismatch { assert_that(p.cargo_process("build"), execs().with_status(101).with_stderr(&format!( r#"no matching package named `notquitebar` found (required by `foo`) -location searched: {proj_dir} +location searched: {proj_dir}/bar version required: * "#, proj_dir = p.url()))); }); @@ -1004,7 +1004,7 @@ test!(verbose_release_build_deps { .file("foo/src/lib.rs", ""); assert_that(p.cargo_process("build").arg("-v").arg("--release"), execs().with_status(0).with_stdout(&format!("\ -{compiling} foo v0.0.0 ({url}) +{compiling} foo v0.0.0 ({url}/foo) {running} `rustc foo[..]src[..]lib.rs --crate-name foo \ --crate-type dylib --crate-type rlib -C prefer-dynamic \ -C opt-level=3 \ diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index 4924787dc..7c2ed6103 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -970,7 +970,7 @@ test!(shared_dep_with_a_build_script { authors = [] [dependencies.a] - path = "../b" + path = "../a" "#) .file("b/src/lib.rs", ""); assert_that(p.cargo_process("build").arg("-v"), diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs index e86144233..28f9ac8be 100644 --- a/tests/test_cargo_compile_git_deps.rs +++ b/tests/test_cargo_compile_git_deps.rs @@ -622,8 +622,8 @@ test!(update_with_shared_deps { execs().with_stdout(&format!("\ {updating} git repository `{git}` {compiling} bar v0.5.0 ({git}#[..]) -{compiling} [..] v0.5.0 ({dir}) -{compiling} [..] v0.5.0 ({dir}) +{compiling} [..] v0.5.0 ([..]) +{compiling} [..] v0.5.0 ([..]) {compiling} foo v0.5.0 ({dir})\n", updating = UPDATING, git = git_project.url(), compiling = COMPILING, dir = p.url()))); @@ -681,8 +681,8 @@ To learn more, run the command again with --verbose. assert_that(p.cargo("build"), execs().with_stdout(&format!("\ {compiling} bar v0.5.0 ({git}#[..]) -{compiling} [..] v0.5.0 ({dir}) -{compiling} [..] v0.5.0 ({dir}) +{compiling} [..] v0.5.0 ({dir}[..]dep[..]) +{compiling} [..] v0.5.0 ({dir}[..]dep[..]) {compiling} foo v0.5.0 ({dir})\n", git = git_project.url(), compiling = COMPILING, dir = p.url()))); diff --git a/tests/test_cargo_compile_path_deps.rs b/tests/test_cargo_compile_path_deps.rs index 4757f3cb9..9eaaac0a8 100644 --- a/tests/test_cargo_compile_path_deps.rs +++ b/tests/test_cargo_compile_path_deps.rs @@ -72,8 +72,8 @@ test!(cargo_compile_with_nested_deps_shorthand { assert_that(p.cargo_process("build"), execs().with_status(0) - .with_stdout(&format!("{} baz v0.5.0 ({})\n\ - {} bar v0.5.0 ({})\n\ + .with_stdout(&format!("{} baz v0.5.0 ({}/bar/baz)\n\ + {} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url(), @@ -90,13 +90,13 @@ test!(cargo_compile_with_nested_deps_shorthand { println!("building baz"); assert_that(p.cargo("build").arg("-p").arg("baz"), execs().with_status(0) - .with_stdout(&format!("{} baz v0.5.0 ({})\n", + .with_stdout(&format!("{} baz v0.5.0 ({}/bar/baz)\n", COMPILING, p.url()))); println!("building foo"); assert_that(p.cargo("build") .arg("-p").arg("foo"), execs().with_status(0) - .with_stdout(&format!("{} bar v0.5.0 ({})\n\ + .with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); @@ -176,15 +176,15 @@ test!(cargo_compile_with_root_dev_deps_with_testing { p2.build(); assert_that(p.cargo_process("test"), execs().with_stdout(&format!("\ -{compiling} [..] v0.5.0 ({url}) -{compiling} [..] v0.5.0 ({url}) +{compiling} [..] v0.5.0 ([..]) +{compiling} [..] v0.5.0 ([..]) {running} target[..]foo-[..] running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", compiling = COMPILING, url = p.url(), running = RUNNING))); +", compiling = COMPILING, running = RUNNING))); }); test!(cargo_compile_with_transitive_dev_deps { @@ -229,7 +229,7 @@ test!(cargo_compile_with_transitive_dev_deps { "#); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); @@ -271,7 +271,7 @@ test!(no_rebuild_dependency { "#); // First time around we should compile both foo and bar assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); @@ -282,7 +282,7 @@ test!(no_rebuild_dependency { p.build(); // rebuild the files (rewriting them in the process) assert_that(p.cargo("build"), - execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); @@ -337,8 +337,8 @@ test!(deep_dependencies_trigger_rebuild { pub fn baz() {} "#); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("{} baz v0.5.0 ({})\n\ - {} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} baz v0.5.0 ({}/baz)\n\ + {} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url(), @@ -355,8 +355,8 @@ test!(deep_dependencies_trigger_rebuild { pub fn baz() { println!("hello!"); } "#).unwrap(); assert_that(p.cargo("build"), - execs().with_stdout(&format!("{} baz v0.5.0 ({})\n\ - {} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} baz v0.5.0 ({}/baz)\n\ + {} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url(), @@ -369,7 +369,7 @@ test!(deep_dependencies_trigger_rebuild { pub fn bar() { println!("hello!"); baz::baz(); } "#).unwrap(); assert_that(p.cargo("build"), - execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); @@ -426,8 +426,8 @@ test!(no_rebuild_two_deps { pub fn baz() {} "#); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("{} baz v0.5.0 ({})\n\ - {} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} baz v0.5.0 ({}/baz)\n\ + {} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url(), @@ -473,7 +473,7 @@ test!(nested_deps_recompile { let bar = p.url(); assert_that(p.cargo_process("build"), - execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} bar v0.5.0 ({}/src/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, bar, COMPILING, p.url()))); @@ -509,14 +509,16 @@ test!(error_message_for_missing_manifest { .file("src/bar/not-a-manifest", ""); assert_that(p.cargo_process("build"), - execs() - .with_status(101) - .with_stderr(&format!("\ + execs().with_status(101) + .with_stderr("\ Unable to update file://[..] Caused by: - Could not find `Cargo.toml` in `{}` -", p.root().join("src").join("bar").display()))); + failed to read `[..]bar[..]Cargo.toml` + +Caused by: + No such file or directory ([..]) +")); }); @@ -678,7 +680,7 @@ test!(path_dep_build_cmd { p.root().join("bar").move_into_the_past().unwrap(); assert_that(p.cargo("build"), - execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); @@ -695,7 +697,7 @@ test!(path_dep_build_cmd { } assert_that(p.cargo("build"), - execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\ + execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\ {} foo v0.5.0 ({})\n", COMPILING, p.url(), COMPILING, p.url()))); @@ -741,8 +743,8 @@ test!(dev_deps_no_rebuild_lib { assert_that(p.cargo("test"), execs().with_status(0) .with_stdout(&format!("\ -{compiling} [..] v0.5.0 ({url}) -{compiling} [..] v0.5.0 ({url}) +{compiling} [..] v0.5.0 ({url}[..]) +{compiling} [..] v0.5.0 ({url}[..]) {running} target[..]foo-[..] running 0 tests diff --git a/tests/test_cargo_compile_plugins.rs b/tests/test_cargo_compile_plugins.rs index 6bbbe8c03..537d065c3 100644 --- a/tests/test_cargo_compile_plugins.rs +++ b/tests/test_cargo_compile_plugins.rs @@ -264,7 +264,7 @@ test!(native_plugin_dependency_with_custom_ar_linker { foo.build(); assert_that(bar.cargo_process("build").arg("--verbose"), execs().with_stdout(&format!("\ -{compiling} foo v0.0.1 ({url}) +{compiling} foo v0.0.1 ([..]) {running} `rustc [..] -C ar=nonexistent-ar -C linker=nonexistent-linker [..]` -", compiling = COMPILING, running = RUNNING, url = bar.url()))) +", compiling = COMPILING, running = RUNNING))); }); diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs index 6536c526e..8c16a485a 100644 --- a/tests/test_cargo_cross_compile.rs +++ b/tests/test_cargo_cross_compile.rs @@ -602,7 +602,7 @@ test!(build_script_needed_for_host_and_target { assert_that(p.cargo_process("build").arg("--target").arg(&target).arg("-v"), execs().with_status(0) .with_stdout_contains(&format!("\ -{compiling} d1 v0.0.0 ({url})", compiling = COMPILING, url = p.url())) +{compiling} d1 v0.0.0 ({url}/d1)", compiling = COMPILING, url = p.url())) .with_stdout_contains(&format!("\ {running} `rustc d1[..]build.rs [..] --out-dir {dir}[..]target[..]build[..]d1-[..]`", running = RUNNING, dir = p.root().display())) @@ -612,7 +612,7 @@ test!(build_script_needed_for_host_and_target { .with_stdout_contains(&format!("\ {running} `rustc d1[..]src[..]lib.rs [..]`", running = RUNNING)) .with_stdout_contains(&format!("\ -{compiling} d2 v0.0.0 ({url})", compiling = COMPILING, url = p.url())) +{compiling} d2 v0.0.0 ({url}/d2)", compiling = COMPILING, url = p.url())) .with_stdout_contains(&format!("\ {running} `rustc d2[..]src[..]lib.rs [..] \ -L /path/to/{host}`", running = RUNNING, host = host)) diff --git a/tests/test_cargo_doc.rs b/tests/test_cargo_doc.rs index 4ce4996c0..a53a62120 100644 --- a/tests/test_cargo_doc.rs +++ b/tests/test_cargo_doc.rs @@ -101,8 +101,8 @@ test!(doc_deps { assert_that(p.cargo_process("doc"), execs().with_status(0).with_stdout(&format!("\ -[..] bar v0.0.1 ({dir}) -[..] bar v0.0.1 ({dir}) +[..] bar v0.0.1 ({dir}/bar) +[..] bar v0.0.1 ({dir}/bar) {documenting} foo v0.0.1 ({dir}) ", documenting = DOCUMENTING, @@ -148,7 +148,7 @@ test!(doc_no_deps { assert_that(p.cargo_process("doc").arg("--no-deps"), execs().with_status(0).with_stdout(&format!("\ -{compiling} bar v0.0.1 ({dir}) +{compiling} bar v0.0.1 ({dir}/bar) {documenting} foo v0.0.1 ({dir}) ", documenting = DOCUMENTING, compiling = COMPILING, diff --git a/tests/test_cargo_features.rs b/tests/test_cargo_features.rs index 11211087b..b7f62c2c8 100644 --- a/tests/test_cargo_features.rs +++ b/tests/test_cargo_features.rs @@ -253,7 +253,7 @@ test!(no_feature_doesnt_build { assert_that(p.cargo("build").arg("--features").arg("bar"), execs().with_status(0).with_stdout(format!("\ -{compiling} bar v0.0.1 ({dir}) +{compiling} bar v0.0.1 ({dir}/bar) {compiling} foo v0.0.1 ({dir}) ", compiling = COMPILING, dir = p.url()))); assert_that(p.process(&p.bin("foo")), @@ -293,7 +293,7 @@ test!(default_feature_pulled_in { assert_that(p.cargo_process("build"), execs().with_status(0).with_stdout(format!("\ -{compiling} bar v0.0.1 ({dir}) +{compiling} bar v0.0.1 ({dir}/bar) {compiling} foo v0.0.1 ({dir}) ", compiling = COMPILING, dir = p.url()))); assert_that(p.process(&p.bin("foo")), @@ -394,8 +394,8 @@ test!(groups_on_groups_on_groups { assert_that(p.cargo_process("build"), execs().with_status(0).with_stdout(format!("\ -{compiling} ba[..] v0.0.1 ({dir}) -{compiling} ba[..] v0.0.1 ({dir}) +{compiling} ba[..] v0.0.1 ({dir}/ba[..]) +{compiling} ba[..] v0.0.1 ({dir}/ba[..]) {compiling} foo v0.0.1 ({dir}) ", compiling = COMPILING, dir = p.url()))); }); @@ -438,8 +438,8 @@ test!(many_cli_features { assert_that(p.cargo_process("build").arg("--features").arg("bar baz"), execs().with_status(0).with_stdout(format!("\ -{compiling} ba[..] v0.0.1 ({dir}) -{compiling} ba[..] v0.0.1 ({dir}) +{compiling} ba[..] v0.0.1 ({dir}/ba[..]) +{compiling} ba[..] v0.0.1 ({dir}/ba[..]) {compiling} foo v0.0.1 ({dir}) ", compiling = COMPILING, dir = p.url()))); }); @@ -499,8 +499,8 @@ test!(union_features { assert_that(p.cargo_process("build"), execs().with_status(0).with_stdout(format!("\ -{compiling} d2 v0.0.1 ({dir}) -{compiling} d1 v0.0.1 ({dir}) +{compiling} d2 v0.0.1 ({dir}/d2) +{compiling} d1 v0.0.1 ({dir}/d1) {compiling} foo v0.0.1 ({dir}) ", compiling = COMPILING, dir = p.url()))); }); @@ -533,14 +533,14 @@ test!(many_features_no_rebuilds { assert_that(p.cargo_process("build"), execs().with_status(0).with_stdout(format!("\ -{compiling} a v0.1.0 ({dir}) +{compiling} a v0.1.0 ({dir}/a) {compiling} b v0.1.0 ({dir}) ", compiling = COMPILING, dir = p.url()))); p.root().move_into_the_past().unwrap(); assert_that(p.cargo("build").arg("-v"), execs().with_status(0).with_stdout(format!("\ -{fresh} a v0.1.0 ([..]) +{fresh} a v0.1.0 ([..]/a) {fresh} b v0.1.0 ([..]) ", fresh = FRESH))); }); diff --git a/tests/test_cargo_install.rs b/tests/test_cargo_install.rs index e56e15e9f..247b654dd 100644 --- a/tests/test_cargo_install.rs +++ b/tests/test_cargo_install.rs @@ -124,7 +124,10 @@ test!(no_crate { `[..]` is not a crate root; specify a crate to install [..] Caused by: - Could not find Cargo.toml in `[..]` + failed to read `[..]Cargo.toml` + +Caused by: + No such file or directory ([..]) ")); }); @@ -197,7 +200,7 @@ binary `foo[..]` already exists in destination as part of `foo v0.1.0 [..]` }); test!(multiple_crates_error { - let p = project("foo") + let p = git::repo(&paths::root().join("foo")) .file("Cargo.toml", r#" [package] name = "foo" @@ -214,14 +217,14 @@ test!(multiple_crates_error { .file("a/src/main.rs", "fn main() {}"); p.build(); - assert_that(cargo_process("install").arg("--path").arg(p.root()), + assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()), execs().with_status(101).with_stderr("\ multiple packages with binaries found: bar, foo ")); }); test!(multiple_crates_select { - let p = project("foo") + let p = git::repo(&paths::root().join("foo")) .file("Cargo.toml", r#" [package] name = "foo" @@ -238,12 +241,14 @@ test!(multiple_crates_select { .file("a/src/main.rs", "fn main() {}"); p.build(); - assert_that(cargo_process("install").arg("--path").arg(p.root()).arg("foo"), + assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()) + .arg("foo"), execs().with_status(0)); assert_that(cargo_home(), has_installed_exe("foo")); assert_that(cargo_home(), is_not(has_installed_exe("bar"))); - assert_that(cargo_process("install").arg("--path").arg(p.root()).arg("bar"), + assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()) + .arg("bar"), execs().with_status(0)); assert_that(cargo_home(), has_installed_exe("bar")); }); @@ -541,7 +546,8 @@ test!(installs_from_cwd_by_default { .file("src/main.rs", "fn main() {}"); p.build(); - assert_that(cargo_process("install"), execs().with_status(0)); + assert_that(cargo_process("install").cwd(p.root()), + execs().with_status(0)); assert_that(cargo_home(), has_installed_exe("foo")); }); diff --git a/tests/test_cargo_package.rs b/tests/test_cargo_package.rs index 2cea29350..072519da7 100644 --- a/tests/test_cargo_package.rs +++ b/tests/test_cargo_package.rs @@ -162,11 +162,24 @@ test!(package_verbose { let mut cargo = ::cargo_process(); cargo.cwd(p.root()); assert_that(cargo.clone().arg("build"), execs().with_status(0)); - assert_that(cargo.arg("package").arg("-v").arg("--no-verify"), + + println!("package main repo"); + assert_that(cargo.clone().arg("package").arg("-v").arg("--no-verify"), execs().with_status(0).with_stdout(&format!("\ {packaging} foo v0.0.1 ([..]) {archiving} [..] {archiving} [..] +", + packaging = PACKAGING, + archiving = ARCHIVING))); + + println!("package sub-repo"); + assert_that(cargo.arg("package").arg("-v").arg("--no-verify") + .cwd(p.root().join("a")), + execs().with_status(0).with_stdout(&format!("\ +{packaging} a v0.0.1 ([..]) +{archiving} [..] +{archiving} [..] ", packaging = PACKAGING, archiving = ARCHIVING))); diff --git a/tests/test_cargo_profiles.rs b/tests/test_cargo_profiles.rs index b41d4e851..e8a6193cd 100644 --- a/tests/test_cargo_profiles.rs +++ b/tests/test_cargo_profiles.rs @@ -78,7 +78,7 @@ test!(top_level_overrides_deps { .file("foo/src/lib.rs", ""); assert_that(p.cargo_process("build").arg("-v").arg("--release"), execs().with_status(0).with_stdout(&format!("\ -{compiling} foo v0.0.0 ({url}) +{compiling} foo v0.0.0 ({url}/foo) {running} `rustc foo{sep}src{sep}lib.rs --crate-name foo \ --crate-type dylib --crate-type rlib -C prefer-dynamic \ -C opt-level=1 \ diff --git a/tests/test_cargo_registry.rs b/tests/test_cargo_registry.rs index bbc531978..0274bd870 100644 --- a/tests/test_cargo_registry.rs +++ b/tests/test_cargo_registry.rs @@ -618,7 +618,7 @@ test!(updating_a_dep { {updating} registry `[..]` {downloading} bar v0.0.1 (registry file://[..]) {compiling} bar v0.0.1 (registry file://[..]) -{compiling} a v0.0.1 ({dir}) +{compiling} a v0.0.1 ({dir}/a) {compiling} foo v0.0.1 ({dir}) ", updating = UPDATING, downloading = DOWNLOADING, compiling = COMPILING, dir = p.url()))); @@ -640,7 +640,7 @@ test!(updating_a_dep { {updating} registry `[..]` {downloading} bar v0.1.0 (registry file://[..]) {compiling} bar v0.1.0 (registry file://[..]) -{compiling} a v0.0.1 ({dir}) +{compiling} a v0.0.1 ({dir}/a) {compiling} foo v0.0.1 ({dir}) ", updating = UPDATING, downloading = DOWNLOADING, compiling = COMPILING, dir = p.url()))); diff --git a/tests/test_cargo_run.rs b/tests/test_cargo_run.rs index 1cb3550aa..cd37c2ea0 100644 --- a/tests/test_cargo_run.rs +++ b/tests/test_cargo_run.rs @@ -332,7 +332,7 @@ test!(example_with_release_flag { assert_that(p.cargo_process("run").arg("-v").arg("--release").arg("--example").arg("a"), execs().with_status(0).with_stdout(&format!("\ -{compiling} bar v0.0.1 ({url}) +{compiling} bar v0.0.1 ({url}/bar) {running} `rustc bar{sep}src{sep}bar.rs --crate-name bar --crate-type lib \ -C opt-level=3 \ -C metadata=[..] \ @@ -361,7 +361,7 @@ fast2 assert_that(p.cargo("run").arg("-v").arg("--example").arg("a"), execs().with_status(0).with_stdout(&format!("\ -{compiling} bar v0.0.1 ({url}) +{compiling} bar v0.0.1 ({url}/bar) {running} `rustc bar{sep}src{sep}bar.rs --crate-name bar --crate-type lib \ -g \ -C metadata=[..] \ diff --git a/tests/test_cargo_rustc.rs b/tests/test_cargo_rustc.rs index cda772606..2816d92a1 100644 --- a/tests/test_cargo_rustc.rs +++ b/tests/test_cargo_rustc.rs @@ -249,7 +249,7 @@ test!(build_foo_with_bar_dependency { execs() .with_status(0) .with_stdout(format!("\ -{compiling} bar v0.1.0 ({url}) +{compiling} bar v0.1.0 ([..]) {running} `[..] -g -C [..]` {compiling} foo v0.0.1 ({url}) {running} `[..] -g -Z unstable-options [..]` @@ -292,11 +292,10 @@ test!(build_only_bar_dependency { execs() .with_status(0) .with_stdout(format!("\ -{compiling} bar v0.1.0 ({url}) +{compiling} bar v0.1.0 ([..]) {running} `[..]--crate-name bar --crate-type lib [..] -Z unstable-options [..]` ", - compiling = COMPILING, running = RUNNING, - url = foo.url()))); + compiling = COMPILING, running = RUNNING))); }); test!(fail_with_multiple_packages { diff --git a/tests/test_cargo_rustdoc.rs b/tests/test_cargo_rustdoc.rs index 0951d831f..8d47bf897 100644 --- a/tests/test_cargo_rustdoc.rs +++ b/tests/test_cargo_rustdoc.rs @@ -89,8 +89,8 @@ test!(rustdoc_foo_with_bar_dependency { execs() .with_status(0) .with_stdout(format!("\ -{compiling} bar v0.0.1 ({url}) -{running} `rustc {bar_dir}{sep}src{sep}lib.rs [..]` +{compiling} bar v0.0.1 ([..]) +{running} `rustc [..]bar{sep}src{sep}lib.rs [..]` {documenting} foo v0.0.1 ({url}) {running} `rustdoc src{sep}lib.rs --crate-name foo \ -o {dir}{sep}target{sep}doc \ @@ -101,8 +101,7 @@ test!(rustdoc_foo_with_bar_dependency { ", running = RUNNING, compiling = COMPILING, sep = SEP, documenting = DOCUMENTING, - dir = foo.root().display(), url = foo.url(), - bar_dir = bar.root().display()))); + dir = foo.root().display(), url = foo.url()))); }); test!(rustdoc_only_bar_dependency { @@ -139,16 +138,15 @@ test!(rustdoc_only_bar_dependency { execs() .with_status(0) .with_stdout(format!("\ -{documenting} bar v0.0.1 ({url}) -{running} `rustdoc {bar_dir}{sep}src{sep}lib.rs --crate-name bar \ +{documenting} bar v0.0.1 ([..]) +{running} `rustdoc [..]bar{sep}src{sep}lib.rs --crate-name bar \ -o {dir}{sep}target{sep}doc \ --no-defaults \ -L dependency={dir}{sep}target{sep}debug{sep}deps \ -L dependency={dir}{sep}target{sep}debug{sep}deps` ", running = RUNNING, documenting = DOCUMENTING, sep = SEP, - dir = foo.root().display(), url = foo.url(), - bar_dir = bar.root().display()))); + dir = foo.root().display()))); }); diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index 7fc0042d2..ab5cf5f77 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -82,7 +82,7 @@ test!(cargo_test_release { assert_that(p.cargo_process("test").arg("-v").arg("--release"), execs().with_stdout(format!("\ -{compiling} bar v0.0.1 ({dir}) +{compiling} bar v0.0.1 ({dir}/bar) {running} [..] -C opt-level=3 [..] {compiling} foo v0.1.0 ({dir}) {running} [..] -C opt-level=3 [..] @@ -314,7 +314,7 @@ test!(test_with_deep_lib_dep { assert_that(p.cargo_process("test"), execs().with_status(0) .with_stdout(&format!("\ -{compiling} foo v0.0.1 ({dir}) +{compiling} foo v0.0.1 ([..]) {compiling} bar v0.0.1 ({dir}) {running} target[..] @@ -951,7 +951,7 @@ test!(test_dylib { assert_that(p.cargo_process("test"), execs().with_status(0) .with_stdout(&format!("\ -{compiling} bar v0.0.1 ({dir}) +{compiling} bar v0.0.1 ({dir}/bar) {compiling} foo v0.0.1 ({dir}) {running} target[..]foo-[..] @@ -1259,7 +1259,7 @@ test!(selective_testing { assert_that(p.cargo("test").arg("-p").arg("d1"), execs().with_status(0) .with_stdout(&format!("\ -{compiling} d1 v0.0.1 ({dir}) +{compiling} d1 v0.0.1 ({dir}/d1) {running} target[..]d1-[..] running 0 tests @@ -1279,7 +1279,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured assert_that(p.cargo("test").arg("-p").arg("d2"), execs().with_status(0) .with_stdout(&format!("\ -{compiling} d2 v0.0.1 ({dir}) +{compiling} d2 v0.0.1 ({dir}/d2) {running} target[..]d2-[..] running 0 tests @@ -1457,7 +1457,7 @@ test!(selective_testing_with_docs { assert_that(p.cargo("test").arg("-p").arg("d1"), execs().with_status(0) .with_stdout(&format!("\ -{compiling} d1 v0.0.1 ({dir}) +{compiling} d1 v0.0.1 ({dir}/d1) {running} target[..]deps[..]d1[..] running 0 tests -- 2.30.2